﻿using System;
using System.Threading;
using System.Threading.Tasks;
using RabbitMQ.Client;

namespace NetMicro.EventBus.RabbitMQ
{
	public interface IChannelFactory : IDisposable
	{
        /// <summary>
        /// 创建频道
        /// </summary>
        IModel CreateChannel(IConnection connection = null);

        /// <summary>
        /// 获取当前有效的频道
        /// </summary>
        Task<IModel> GetChannelAsync();

        /// <summary>
        /// 创建频道
        /// </summary>
        Task<IModel> CreateChannelAsync(IConnection connection = null);
    }
}
